#pragma once
#include <list>
#include "dataTypes.h"
#include "Skeleton.h"
#include "Inventory.h"
#include "Quest.h"
using namespace std;

class Quest;

struct Trace
{
	Point position;
	float alpha;
	bool isVertical;
};

class Character
{
	friend class CharacterDrawer;

	public:
		Character();
		Character(int aJob, int aBiome, bool aHero = false);
		~Character();

		void Tick();

		void SetPosition(int aX, int aY);
		int GetPositionX() {return mapPositionX;};
		int GetPositionY() {return mapPositionY;};
		float GetOffsetX() {return positionOffsetX;};
		float GetOffsetY() {return positionOffsetY;};
		int GetAge() {return age;};
		int GetProfession() {return job;};
		int GetHeight() {return height;};
		list<Trace>* GetTraces() {return &traces;};

		int GetGold() { return gold;};
		void SetGold(int aGold) { gold = aGold;};

		string GetName() {return name;};

		void SetVisibility(bool aVisible) {isVisible = aVisible;};
		bool IsVisible() {return isVisible;};

		bool HasChanged() {return hasChanged;};
		void Refreshed() {hasChanged = false;};

		void SetFacing(int aDir) {facing = aDir;};
		void SetFacing(int aX, int aY);
		int GetFacing() {return facing;};

		bool IsMale() {return male;};
		bool IsMoving() {return isMoving;};
		bool IsMobile() {return mobile;};
		void SetMobile(bool aMob) {mobile = aMob;};
		void SetTrace(bool aTrace) {traceOn = aTrace;};

		vector<Item>* GetClothes() { return &(inventory->clothes); };
		Inventory* GetInventory() { return inventory;};

		bool HaveCloth(ECloth aType);
		bool HaveDress();
		bool HaveItem(Item* aItem);

		void Move(int aDir);
		void Stop();

		void RegenerateCharacter();

		bool robbed;
		int mood;
		float intoxication;
		int defaultFacing;
		bool isGhost;

		vector<Quest*> quests;

	private:
		bool male;
		string name;
		int race;
		int age;
		int hairCut;
		int hairColor;
		int job;
		int height;
		int weight;
		float speed;
		int gold;

		bool mobile;
		int facing;
		bool traceOn;
		bool leftFoot;
		list<Trace> traces;

		Inventory* inventory;

		int mapPositionX;
		int mapPositionY;
		float positionOffsetX;
		float positionOffsetY;
		int seed;
		bool isVisible;
		bool hasChanged;

		bool isMoving;
		bool stopFlag;
		int animationFrame;
		int animation;

		Skeleton* skeleton;
};

